<template>
	<view class="header" :style="{paddingTop:customBar + 'rpx',background:'url(' + bg.bg1+')',backgroundSize:'cover'}">
		<view class="header-title">
			<!-- <image :src=" $BASE_URL+bg.title" mode="aspectFill" style=""></image> -->
			<view style="font-size: 34rpx;height: 54rpx;line-height: 64rpx;font-weight: bold;margin-left: 40rpx;">

				悟空租 | 聪明租机大平台

			</view>
		</view>
		<view class="header-search" @click="jump('/pages/activity/search/searchitem')">
			<view class="search-icon">
				<image src="../../../static/images/search.png" mode="aspectFill"></image>
				<view class="search-val" style="font-size:28rpx !important;
					color: #CCCCCC !important;">
					iphone 新款
				</view>
			</view>
			<view class="search-btn">
				搜索
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				statusBar: 0,
				customBar: 0,
				bg: {
					// 背景图
					bg1: '',
					bg2: '',
					title: ''
				}
			}
		},
		mounted() {
			uni.getSystemInfo({
				success: (e) => {
					// console.log(e);

					// #ifdef MP-ALIPAY
					this.statusBar = e.statusBarHeight
					this.customBar = e.statusBarHeight + e.titleBarHeight

					// #endif


					// #ifdef APP-PLUS || H5
					// console.log(this.statusBar);
					this.customBar = e.statusBarHeight * 2
					// #endif
				}
			})
			this.getPic()


		},
		methods: {
			jump(path, parmas) {
				this.$Router.push({
					path: path,
					query: parmas
				});
			},
			getPic() {

				this.$http('common.getPic', {

				}).then(res => {
					if (res.code === 1) {
						// console.log(res);
						this.bg.bg1 = res.data.result.navBarBg
						this.bg.bg2 = res.data.result.navBarBg2
						this.bg.title = res.data.result.indexPage
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	.header {

		width: 100%;

		/* #ifdef MP-ALIPAY */
		height: 260rpx;
		/*	#endif */
		/* #ifdef APP-PLUS */
		height: 220rpx;
		/*	#endif */

		// box-sizing: border-box;
		padding-bottom: 20rpx;

		.header-title {
			display: flex;
			align-items: flex-start;
			height: 85rpx;
			line-height: 85rpx;
			font-size: 32rpx;
			box-sizing: border-box;
			padding-left: 38rpx;
			padding-top: 8rpx;

			image {
				width: 176rpx;
				height: 54rpx;

			}

		}

		.header-search {
			width: 710rpx;
			height: 64rpx;
			border-radius: 32rpx;
			background-color: #fff;
			margin: 0 auto;
			display: flex;
			padding: 0 10rpx;
			box-sizing: border-box;
			justify-content: space-between;
			align-items: center;

			.search-icon {
				display: flex;
				// width: 36rpx;
				height: 34rpx;

				image {
					width: 36rpx;
					height: 34rpx;
					margin-right: 20rpx;

					.search-val {}

				}
			}

			.search-btn {
				width: 110rpx;
				height: 52rpx;
				background-color: #FF4747;
				color: #fff;
				line-height: 52rpx;
				text-align: center;
				border-radius: 26rpx;
			}
		}
	}
</style>
